package com.czxy.demo01;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class UserAspect02 {


    @Before("execution(public  int  com.czxy.demo01.User.count())")
    public  void  bfCount(){
        System.out.println("沐浴");
    }

    @AfterReturning(value = "execution(public  int  com.czxy.demo01.User.count())",returning = "rel")
    public  void reCount(int rel){
        System.out.println("方法执行完毕 增强 获取返回值 rel="+ rel);
    }


    @AfterThrowing(value = "execution(public  int  com.czxy.demo01.User.count())",throwing = "ex")
    public  void   afECount(Throwable ex){
        System.out.println("检测到  count 出现了异常  记录异常信息" +ex.getMessage());
    }

    @After("execution(public  int com.czxy.demo01.User.count())")
    public  void  afCount(){
        System.out.println("来 来 来");
    }




































}
